#include "msgdialog.h"
#include "ui_MsgWidget.h"
#include <QDebug>


MsgDialog::MsgDialog(QString path, QString name,int num,int sell,QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MsgWidget)
{
    ui->setupUi(this);

    this->setAttribute(Qt::WA_StyledBackground, true);
    ui->label->setAttribute(Qt::WA_StyledBackground, true);
    this->setObjectName("widget");
    this->setStyleSheet("#widget{background-image: url(:/res/beijing.jpg);}");

    //move(0, 40);
    //border-image:url(:/res/bali.png);
    //border-image:url(:/res/bali.png)
    QString img = QString("border-image:url(:/res/%1);").arg(path.simplified());
    qDebug() << "path = " << img;
    ui->label->setStyleSheet(img);//:/res/bali.png
    ui->name_label->setText(QString("《%1》").arg(name));
    ui->num_label->setText(QString("在馆书籍（本）：%1").arg(num));
    ui->sell_label->setText(QString("借阅所需积分：%1").arg(sell));
}

MsgDialog::~MsgDialog()
{
    delete ui;
}

void MsgDialog::on_pushButton_clicked()
{
    this->close();
}
